package com.example.controller;

import com.example.domain.Department;
import com.example.mapper.DepartmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <h3>springboot-mybatis</h3>
 * <p></p>
 *
 * @author : 你的名字
 * @date : 2020-03-02 20:38
 **/
@RestController
public class DepartmentController {
    @Autowired
    private DepartmentMapper departmentMapper;

    @GetMapping("/depts")
    public List<Department> getDepartMents() {
        return departmentMapper.findAll();
    }
}
